package com.mao.service.impl.organization;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mao.action.jsonvo.organization.JsonVoOrganization;
import com.mao.dao.organization.OrganizationDao;
import com.mao.model.organization.Organization;
import com.mao.service.organization.IOrganizationService;

@Service("organizationService")
public class OrganizationServiceImpl implements IOrganizationService {
	private OrganizationDao organizationDao;

	public List<Organization> getAllOrganization() {
		return organizationDao.getAllOrganization();
	}

	public Organization saveOrganization(Organization o) {
		return organizationDao.saveOrganization(o);
	}

	public Organization updateOrganization(Organization o) {
		return organizationDao.updateOrganization(o);
	}

	public Organization getOrganizationById(long id) {
		return organizationDao.getOrganizationById(id);
	}
	
	public List<JsonVoOrganization> getOrgsByOrgClass(OrganizationCondition organizationCondition,long orgClassId,Integer page,Integer rows){
		return organizationDao.getOrgsByOrgClass(organizationCondition,orgClassId,page,rows);
	}
	
	public int getOrgsByOrgClassgCount(OrganizationCondition organizationCondition,long orgClassId){
		return organizationDao.getOrgsByOrgClassgCount(organizationCondition,orgClassId);
	}

	public OrganizationDao getOrganizationDao() {
		return organizationDao;
	}

	@Autowired
	public void setOrganizationDao(OrganizationDao organizationDao) {
		this.organizationDao = organizationDao;
	}

	@Override
	public String valDelOrg(long id) {
		// TODO Auto-generated method stub
		return organizationDao.valDelOrg(id);
	}

}
